<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:p="http://primefaces.org/ui">
	  
<f:view locale="#{switcher.currentLocale}">	  

<h:head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">

</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

<style type="text/css">  
           .ui-widget {  
               font-size: 15px !important;  
           }  
</style>
  
       
<title>#{msg.listaFavoritos}</title>

	<ui:include src="/layout/Header.xhtml" />
</h:head>

<h:body>
	<ui:include src="/layout/SubMenu_Favoritos.xhtml" />
<h:form>
<center>

	<div style="width:50%">
	<p:dataTable var="i" value="#{listaFavoritos}">
	    <f:facet name="header">
           #{msg.favoritos}
       	 </f:facet>
	    <p:column headerText="#{msg.nome}">
	        <h:commandLink id="selecionar" value="#{i.nome}" action="#{transacaoManagedBean.selecionarFavorito}" >
				<f:setPropertyActionListener target="#{transacaoManagedBean.favorito}" value="#{i}"/>
			</h:commandLink>
	    </p:column>
	 
	    <p:column headerText="#{msg.ag}">
	        <h:outputText value="#{i.agencia}" />
	    </p:column>
	 	 
	    <p:column headerText="#{msg.conta}">
	        <h:outputText value="#{i.contaC}" />
	    </p:column>
	    
	    <p:column>
	    	<h:commandLink id="alterar" value="#{msg.alterar}" action="alterarFavoritos.faces?faces-redirect=true" >
				<f:setPropertyActionListener target="#{favoritoManagedBean.f}" value="#{i}"/>
			</h:commandLink>	
	    </p:column>
	    
	    <p:column>
	   	 	<h:commandLink id="excluir" value="#{msg.excluir}" onclick="return confirm('#{msg.confirmDelete}')" action="#{favoritoManagedBean.excluirFavorito}" >
				<f:setPropertyActionListener target="#{favoritoManagedBean.pk}" value="#{i.id}"/>
			</h:commandLink>	
	    </p:column>
	</p:dataTable>
	</div>
	
	<br/>	
	*#{msg.clickToTransf}
	
</center>	
</h:form>
</h:body>
</f:view>
</html>